package com.wsoft.bpm.component;

import org.activiti.bpmn.model.BaseElement;
import org.activiti.bpmn.model.UserTask;
import org.activiti.editor.language.json.converter.BaseBpmnJsonConverter;
import org.activiti.editor.language.json.converter.BpmnJsonConverter;

import java.util.Map;

/**
 * 功能描述
 *
 * @author: juiet
 * @date: 2024年09月28日 10:49
 */
public class CustomBpmnJsonConverter extends BpmnJsonConverter {

    public CustomBpmnJsonConverter(){
        super();
        //修改默认解析器
        getConvertersToBpmnMap().put(STENCIL_TASK_USER, CustomUserTaskJsonConverter.class);
        getConvertersToJsonMap().put(UserTask.class,CustomUserTaskJsonConverter.class);
    }

    public static Map<String,Class<? extends BaseBpmnJsonConverter>> getConvertersToBpmnMap(){
        return convertersToBpmnMap;
    }
    public static Map<Class<? extends BaseElement>, Class<? extends BaseBpmnJsonConverter>> getConvertersToJsonMap(){
        return convertersToJsonMap;
    }
}
